import request from '@/utils/request'

// api地址
const api = {
	home: 'withdraw/home',
	account: 'withdraw/account',
	saveAccount: 'withdraw/saveaccount',
	withdraw: 'withdraw/withdraw',
	withdrawDetail: 'withdraw/detail',
	withdrawList: 'withdraw/list',
}

// 我的资产
export function home() {
	return request.get(api.home)
}

// 收款账号信息
export function account() {
	return request.get(api.account, {}, {
		isPrompt: false
	})
}

// 保存收款账号信息
export function saveAccount(data) {
	return request.post(api.saveAccount, data)
}

// 提现
export function withdraw(data) {
	return request.post(api.withdraw, data, {
		isPrompt: false,
		load: true
	})
}

// 提现详情
export function withdrawDetail(id) {
	return request.get(api.withdrawDetail, {
		id
	})
}

// 提现记录
export function withdrawList(page) {
	return request.get(api.withdrawList, {
		page
	})
}